package com.gimi.cloud.jimi.common.utils.reqhead;


import com.gimi.cloud.jimi.common.enums.ResponseCodeEnum;
import com.gimi.cloud.jimi.common.utils.StringUtil;

public class Response {

    /**
     * 响应代码
     */
    private String res_code = "-1";
    /**
     * 相应描述
     */
    private String res_msg;

    /**返回数据*/
	private Object res_data;
	
	

    public Object getRes_data() {
        return res_data;
    }

    public void setRes_data(Object res_data) {
        this.res_data = res_data;
    }

    public String getRes_code() {
        return res_code;
    }

    public void setRes_code(String res_code) {
        this.res_code = res_code;
    }

    public String getRes_msg() {
        return res_msg;
    }

    public void setRes_msg(String res_msg) {
        this.res_msg = res_msg;
    }

    /**
     * 设置返回编码
     *
     * @param status
     */
    public void setResponseCode(ResponseCodeEnum status) {
        setResponseCode(status, null);
    }

    /**
     * 设置返回编码
     *
     * @param status
     */
    public void setResponseCode(ResponseCodeEnum status, Object extStr) {
        this.res_code = status.getStatus();
        this.res_msg = StringUtil.isBlank(extStr) ? status.getDesc() : extStr+ "";
    }

    /**
     * 设置返回的code和msg
     * @param res_code
     * @param res_msg
     */
    public void setResponseCode(String res_code, String res_msg) {
        this.res_code = res_code;
        this.res_msg = res_msg;
    }
}
